<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
namespace App\Record\Request;

use Mine\MineFormRequest;

/**
 * 成功订单记录验证数据类
 */
class RecordPaymentSuccessRequest extends MineFormRequest
{
    /**
     * 公共规则
     */
    public function commonRules(): array
    {
        return [];
    }

    
    /**
     * 新增数据验证规则
     * return array
     */
    public function saveRules(): array
    {
        return [
            //到账金额 验证
            'received_amount' => 'required',
            //内部订单号 验证
            'order_sn' => 'required',
            //外部订单号 验证
            'transaction_id' => 'required',
            //支付方式 验证
            'method_id' => 'required',
            //支付名称 验证
            'method_name' => 'required',

        ];
    }
    /**
     * 更新数据验证规则
     * return array
     */
    public function updateRules(): array
    {
        return [
            //到账金额 验证
            'received_amount' => 'required',
            //内部订单号 验证
            'order_sn' => 'required',
            //外部订单号 验证
            'transaction_id' => 'required',
            //支付方式 验证
            'method_id' => 'required',
            //支付名称 验证
            'method_name' => 'required',

        ];
    }

    
    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'id' => 'Id',
            'user_id' => '用户id',
            'parent_id' => '上级ID',
            'received_amount' => '到账金额',
            'order_sn' => '内部订单号',
            'transaction_id' => '外部订单号',
            'method_id' => '支付方式',
            'method_name' => '支付名称',

        ];
    }

}